<template>
  <div class="zh-login">
    <div class="login-top">
      Welcome To Julius
    </div>
    <div class="login-content">
      <div class="user">
        <span>帐号:</span>
        <input type="text" v-model="user" class="user input" maxlength="11">
      </div>
      <div class="password">
        <span>密码:</span>
        <input type="password" v-model="password" @keyup.enter.native="login" maxlength="8" class="password input">
      </div>
    </div>
    <div class="register" @click="login">
      立即登录
    </div>
    <div class="forget">
      <div class="l">忘记密码</div>
      <div class="c">|</div>
      <div class="r">注册帐号</div>
    </div>
    <div class="sanfang">
      <div class="t">------------  第三方登录 -----------</div>
      <div class="b">
        <div class="box" v-for="item in 3" :key="item">{{ item }}</div>
      </div>
    </div>
    <div class="login-footer"></div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      user: '',
      password: ''
    }
  },
  methods: {
    login () {
      window.localStorage.setItem('userInfo', JSON.stringify({ user: this.user, password: this.password }))
      window.localStorage.setItem('dateInfo', +new Date())
      if (this.user === '' || this.password === '') {
        this.$toast('请输入帐号信息')
      } else {
        this.$router.push({ path: '/index' })
      }
    }
  }
}
</script>

<style lang='less' scoped>
  .zh-login {
    height: 100%;
    background:linear-gradient(135deg, #6bc8b5, #3679ca);
    .login-top {
      color: #fff;
      font-size: 24px;
      text-align: center;
      padding-top: 50px;
    }
    .login-content {
      margin-top: 50px;
      height: 130px;
      display: flex;
      justify-content: space-around;
      flex-direction: column;
      align-items: center;
      span {
        font-size: 20px;
        color: #fff;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
      }
      .user {
        border: 1px solid #eee;
        border-radius: 10px;
        width: 80%;
        height: 45px;
        padding-left: 10px;
        position: relative;
        box-sizing: border-box;
      }
      .password {
        position: relative;
        width: 80%;
        height: 45px;
        border: 1px solid #eee;
        border-radius: 10px;
        padding-left: 10px;
        box-sizing: border-box;
      }
      .input {
        // padding: 0px 15px;
        padding-left: 50px;
        padding-right: 15px;
        border: none;
        outline: none;
        opacity: 1;
        background-color: rgba(0, 0, 0, 0);
        color: #fff;
        font-size: 24px;
        box-sizing: border-box;
      }
    }
    .register {
      text-align: center;
      background: #56b3f6;
      width: 80%;
      margin: 0 auto;
      border-radius: 10px;
      height: 40px;
      line-height: 40px;
      font-size: 20px;
      color: #fff;
      box-shadow: 0px 0px 2px 0px rgba(206, 217, 223, 0.4);
      margin-top: 20px;
      font-style: initial;
      font-weight: 100;
      letter-spacing: 1.5px;
    }
    .forget {
      display: flex;
      font-size: 14px;
      color: #ebfbf8;
      align-items: center;
      justify-content: center;
      margin-top: 10px;
      .c {
        margin: 0 5px;
      }
    }
    .sanfang {
      margin-top: 70px;
      display: flex;
      flex-direction: column;
      align-items: center;
      .t {
        font-size: 14px;
      }
      .b {
        margin-top: 20px;
        display: flex;
        justify-content: space-around;
        width: 70%;
        .box {
          width: 50px;
          height: 50px;
          border-radius: 50%;
          background: #56b3f6;
          text-align: center;
          line-height: 50px;

        }
      }
    }
  }
</style>
